package sk.project.accounting.data.model;

// Generated Dec 17, 2012 9:50:06 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * IssueCard generated by hbm2java
 */
@Entity
@Table(name = "issue_card", catalog = "skl_hosp_new")
public class IssueCard implements java.io.Serializable {

	private Integer id;
	private Commodity commodity;
	private Integer price;
	private Date date;
	private Integer amount;
	private Integer idBranchOffice;
	private Set<CommodityMovement> commodityMovements = new HashSet<CommodityMovement>(
			0);

	public IssueCard() {
	}

	public IssueCard(Commodity commodity, Integer price, Date date,
			Integer amount, Integer idBranchOffice,
			Set<CommodityMovement> commodityMovements) {
		this.commodity = commodity;
		this.price = price;
		this.date = date;
		this.amount = amount;
		this.idBranchOffice = idBranchOffice;
		this.commodityMovements = commodityMovements;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_commodity")
	public Commodity getCommodity() {
		return this.commodity;
	}

	public void setCommodity(Commodity commodity) {
		this.commodity = commodity;
	}

	@Column(name = "price")
	public Integer getPrice() {
		return this.price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "amount")
	public Integer getAmount() {
		return this.amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	@Column(name = "id_branch_office")
	public Integer getIdBranchOffice() {
		return this.idBranchOffice;
	}

	public void setIdBranchOffice(Integer idBranchOffice) {
		this.idBranchOffice = idBranchOffice;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "issueCard")
	public Set<CommodityMovement> getCommodityMovements() {
		return this.commodityMovements;
	}

	public void setCommodityMovements(Set<CommodityMovement> commodityMovements) {
		this.commodityMovements = commodityMovements;
	}

}
